package medium;

/**
 * 1535. 找出数组游戏的赢家
 * 创建时间：2024-05-19 0:38
 **/
public class 找出数组游戏的赢家_1535 {
    class Solution {
        public int getWinner(int[] arr, int k) {
            ;
            int max = arr[0], win = 0;
            for (int i = 1; i < arr.length && win < k; i++) {
                if (arr[i] > max) {
                    max = arr[i];
                    win = 0;
                }
                win++;
            }
            return max;
        }
    }
}
